﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Program13
{
    class Program
    {
        //Directory 文件夹处理
        static void Main(string[] args)
        {
            //创建文件夹
            //Directory.CreateDirectory(@"G:\Gitee\CsharpAdvanced\Program13\axb");
            //Console.WriteLine("创建成功");

            //删除文件夹
            //if (Directory.Exists(@"G:\Gitee\CsharpAdvanced\Program13\1.txt"))
            //{
            //    Directory.Delete(@"G:\Gitee\CsharpAdvanced\Program13\1.txt");
            //    Console.WriteLine("删除成功");
            //}

            //移动文件夹
            //string sourceFolder = @"G:\Gitee\CsharpAdvanced\Program13\1.txt";
            //string targetFolder = @"G:\Gitee\CsharpAdvanced\Program13\2.txt";
            //Directory.Move(sourceFolder, targetFolder);
            //Console.WriteLine("剪切成功");

            //判断文件夹是否存在
            //if (Directory.Exists(@"G:\Gitee\CsharpAdvanced\Program13\axb"))
            //{
            //    for (int i = 0; i < 10; i++)
            //    {
            //        Directory.CreateDirectory(@"G:\Gitee\CsharpAdvanced\Program13\axb\" + i);
            //    }
            //}

            //列出文件夹
            //string keyPath = "5";
            //string[] path = Directory.GetDirectories(@"G:\Gitee\CsharpAdvanced\Program13\axb");
            //foreach (var item in path)
            //{
            //    if (item.Contains(keyPath))
            //    {
            //        Console.WriteLine(item);
            //        break;
            //    }
            //}

            //列出文件名
            //string[] files = Directory.GetFiles(@"G:\Gitee\CsharpAdvanced\Program13\axb", "axb");
            //foreach (var item in files)
            //{
            //    Console.WriteLine(item);
            //}
            Console.ReadLine();
        }
    }
}
